<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">

  <title>includes</title>
  <link href="../cppreference.css" rel="stylesheet" type="text/css">
</head>

<body>
<table>
  <tr>
  <td>
  <div class="body-content">

  <div class="header-box">
    <a href="../index.html">cppreference.com</a> &gt; <a href=
    "index.html">C++ Algorithms</a> &gt; <a href=
    "includes.html">includes</a>
  </div>

  <div class="name-format">
    includes
  </div>

  <div class="syntax-name-format">
    Syntax:
  </div>
  <pre class="syntax-box">
  #include &lt;algorithm&gt;
  bool includes( iterator start1, iterator end1, iterator start2, iterator end2 );
  bool includes( iterator start1, iterator end1, iterator start2, iterator end2, StrictWeakOrdering cmp );
</pre>

  <p>The includes() algorithm returns true if every element in
  [<em>start2</em>,<em>end2</em>) is also in
  [<em>start1</em>,<em>end1</em>). Both of the given ranges must be
  sorted in ascending order.</p>

  <p>By default, the &lt; operator is used to compare elements. If the
  strict weak ordering function object <em>cmp</em> is given, then it
  is used instead.</p>

  <p>includes() runs in <a href="../complexity.html">linear
  time</a>.</p>

  <div class="related-name-format">
    Related topics:
  </div>

  <div class="related-content">
    <a href="set_difference.html">set_difference</a><br>
    <a href="set_intersection.html">set_intersection</a><br>
    <a href=
    "set_symmetric_difference.html">set_symmetric_difference</a><br>
    <a href="set_union.html">set_union</a>
  </div>
  </div>
  </td>
  


  </tr>
  </table>
</body></html>
